home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / script / more < prev    next >
Encoding:
Text File  |  2002-10-28  |  710 b   |  49 lines

  1. #
  2. # A file pager.  A demonstration of how to do something useful in ircII.
  3. # Written by archon in 1996
  4. #
  5.  
  6. alias more 
  7. {
  8.     if ([$0]) 
  9.     {
  10.         @ line = 0
  11.         @ done = 0
  12.         @ rows = winsize() - 1
  13.         if (fexist($0) == 1) 
  14.         {
  15.             @ fd = open($0 R)
  16.             while (!eof($fd) && (pause!=[q]))
  17.             {
  18.                 while (line++ != rows) 
  19.                 {
  20.                     @ ugh = read($fd)
  21.                     if (eof($fd)) 
  22.                     {
  23.                         @ line = rows
  24.                         @ done = 1
  25.                     }
  26.                     {
  27.                         echo $ugh
  28.                     }
  29.                 }
  30.                 if (!done) 
  31.                 {
  32.         ^assign pause $"Enter q to quit, or anything else to continue "
  33.         @ line = 0
  34.                 }
  35.             }
  36.             @ close($fd)
  37.             @ fd = line = done = rows = pause = ugh = []
  38.         }
  39.         {
  40.             echo $0\: no such file.
  41.         }
  42.     }
  43.     {
  44.         echo Usage: /more <filename>
  45.     }
  46. }
  47.  
  48. #archon'96
  49.